﻿using ServerCommon.Architecture;
using ServerCommon.Log;

namespace DatabaseServer
{
    public class Program
    {
        public const string AppName = "DatabaseServer";
        public const string Log4NetName = "/DatabaseLog4net.xml";

        static void Main(string[] args)
        {
            string ConfigPath = CommandLineHelper.GetOption(args, 0, "../../../../../Configs");

            string logConfigFile = ConfigPath + Log4NetName;
            LogHelper.Init(logConfigFile, true, "./Log", AppName);

            ProgramDatabaseServer.Instance?.Init(ProgramServerType.Database, AppName, ConfigPath);

            ProgramDatabaseServer.Instance?.Run();

            ProgramDatabaseServer.Instance?.Release();

            LogHelper.Release();
        }
    }
}
